from numbers import isPalindrome

max = 0

for i in range(999,0, -1):
    for j in range(999, i-1, -1):
        k = i * j
        if isPalindrome(k):
            print i, " * ", j, " = ", k
            if k > max:
                max = k
                
print max
